230_kthSmallest_recur.pyclass Solution(object):
    def kthSmallest(self, root, k):
        """
        :type root: TreeNode
        :type k: int
        :rtype: int
        """
        def DFS(root, k):
            stack = []
            while root != None or len(stack) > 0:
                while root != None:
                    stack.append(root)
                    root = root.left
                node = stack[-1]
                stack.pop()
                k -= 1
                if k == 0:
                    return node.val
                root = node.right
            return -1
        return DFS(root, k)
